1. Field of the Invention
A data transfer method is classified as either a parallel transfer which uses a parallel data bus or a serial transfer which uses a serial data bus. The parallel transfer is suitable to a high speed data transfer, but it leads to the increase of the number of pins of a device such as a microprocessor or an IC.
The serial transfer is sufficient for a one-chip microprocessor used in audio/video equipment or home equipment from a standpoint of a transfer speed. Accordingly, such equipment uses the serial transfer which can reduce the number of pins of the microprocessor. Recently, as performance of such equipment has been improved, a plurality of microprocessors have been built into one product such as a video tape recorder or a camera with built-in video equipment. Those microprocessors do not operate independently but operate while transferring data to each other through the serial data bus. Not only, the microprocessors, but also various IC's and LSI's, may be connected to the serial data bus.
The present invention relates to a data transfer method in which data frames are serially transferred between a plurality of devices (particularly microprocessors).
2. Description of the Prior Art
One of the prior art data transfer methods by serial transfer is an I.sup.2 C (Inter-Integrated Circuit) method disclosed in ELECTRIC COMPONENTS AND APPLICATIONS Vol. 5, No. 4, September 1983, pages 214-211.
The I.sup.2 C as an example of the prior art data transfer method is explained below.
FIG. 9 shows a timing chart of the data transfer by the I.sup.2 C. The I.sup.2 C uses two signal lines, a data line, and a clock line to transfer data at a timing shown in FIG. 9. The transfer is made nine bits at a time, namely, 8-bit data and a one-bit acknowledge bit (hereinafter referred to as an ACK bit). A sending station first outputs the 8-bit data on a data line with an MSB at a first portion, in synchronism with a clock; a receiving station outputs an ACK bit at the next clock.
The sending station outputs a high level on the data line while the receiving station outputs the ACK bit, but since the receiving station outputs a low level on the data line, the data line is maintained at the low level as a whole. At the ninth bit, the sending station knows that the data line is at the low level in spite of the fact that it outputs the high level and recognizes the reception of the data by the receiving station.
FIG. 10 shows a format of a data frame in the data transfer by the I.sup.2 C. In FIG. 10, a start condition 51 and a stop condition 56 are a start condition and a stop condition for the transfer of the data frame, respectively. As shown in FIG. 9, in the I.sup.2 C, the data line may transit only when the clock line is at the low level. Exceptions of the rule are the start condition 51 and the stop condition 56. Under the start condition 51, the data line transits from the high level to the low level when the clock line is at the high level. Under the stop condition 56, the data line transits from the low level to the high level when the clock line is at the high level. The start condition 51 is initiated prior to the transfer of the data frame, and the stop condition 56 indicates the end of the transfer of the data frame.
A leading byte of the data frame comprises a 7-bit slave address 52 and a 1-bit R/W bit 53. The slave address 52 is a 7-bit address which is used to designate one of the devices connected to the I.sup.2 C as a slave. A device which starts the transfer of the data frame is called a master. The master generates the start condition 51 to output the slave address in order to designate the slave to which the data is to be transferred. The R/W bit 53 designates whether the master or the slave is to output data 54 in a second and subsequent bytes of the data frame. When the R/W bit 53 is at the high level, the slave outputs the subsequent data, and the master, which is the receiving station, outputs the ACK bit 55. When the R/W bit 53 is at the low level, the master output the subsequent data 54, and the slave, which is the receiving station, outputs the ACK bit 55. Since the master always outputs the leading byte of the data frame, the slave always output the ACK bit 57.
In the I.sup.2 C, the one-to-one transfer is made between the master and the slave as described above. After the master has generated the start condition 51, it designates the slave by the slave address 52 of the first output byte. The slave address 52 includes an address called a general call address. It has a value of 00 h (hexadecimal notation) and can designate all devices as slaves. When this address is used, all devices must theoretically respond, but it is permitted to ignore the address. Namely, when the general call address is used, the data frame can be sent to all devices which acknowledge the address.
The sending of the same data frame to a plurality of destinations is generally called a broadcasting communication.
In the prior art system, however, since the general call address is prepared only for the broadcasting communication, the broadcasting communication to designated plurality of devices is not attained. Assuming, for example, that five devices A, B, C, D and E are connected to a bus and the devices B, C and D acknowledge the general call address. In this case, the device A may make the broadcasting communication to the devices B, C and D, but it cannot make the broadcasting communication to the devices B and D, or the devices C, D and E.
Further, in the prior art system, since the ACK bit comprises one bit, the sending station cannot check whether all devices have received the data frame in the broadcasting communication. In the above example, when the device A makes the broadcasting communication to the devices B, C and D, the data line is at the low level if one of the devices B, C and D outputs the ACK bit. Accordingly, it is not clear whether all of the devices B, C and D have acknowledged.
In the prior art system, the ACK bit is unconditionally output when one-byte data is received. Accordingly, even if an error occurs in the course of data transmission and erroneous data is sent to the slave, neither the master nor the slave can detect it.
In a prior art multi-master system in which a plurality of devices may be masters, the plurality of masters may simultaneously start the transfer, and the data frame may not be normally transferred. In order to avoid it, such a result is necessary for the I.sup.2 C to monitor the data or clock which it generates. If the data line is at the low level in spite of the fact that the high level is output to the data line, the transfer must immediately be stopped. One method to avoid such a collision is a token system transfer method which is one implementation of LAN (local area network). (For example, see Computer Design, January 1986, pages 40- 41). In the token system, a device which has received a token gets a right to use the bus to transfer the data frame. In this system, it is necessary to modulate the token and the data in a predetermined procedure before they are sent out so that they are different from each other. If modulation is not made, a pattern in use for a token may not be used in the data frame.
Where the I.sup.2 C is to be used in the multi-master system or where the token system is used, there is no device which manages the entire bus system, and all devices connected to the bus are equal for the right to use the bus. However, it is preferable if a priority may be set for each device as to the use of the bus because freedom of overall system design increases. However, where non-specified devices are connected like the LAN, a complex protocol is required to set the priority.
In the I.sup.2 C, it is necessary that the device which uses the bus as the master always output the clock. Accordingly, all devices which can be masters must have functions to output the clock. Where a system is designed such that one device outputs the transfer clock, the device which outputs the clock must confirm that the device which is to output the data is ready to output.